package com.mall.user.api;

import com.mall.user.entity.param.UserAddParam;
import com.mall.user.entity.param.UserEditParam;
import com.mall.user.entity.vo.UserVO;
import com.mall.user.entity.vo.UserWithRoleInfoVO;
import com.mall.user.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @className: com.mall.user.service.impl-> UserApiImpl
 * @description:
 * @author: wuyijie
 * @createDate: 2021/6/23 0:01
 */
@DubboService
@Slf4j
public class UserApiImpl implements UserApi {
    @Autowired
    private IUserService userService;

    @Override
    public int add(UserAddParam userAddParam) {
        return userService.add(userAddParam);
    }

    @Override
    public int deleteById(int id) {
        return userService.deleteById(id);
    }

    @Override
    public int edit(UserEditParam userEditParam) {
        return userService.edit(userEditParam);
    }

    @Override
    public UserVO queryById(int id) {
        return userService.queryById(id);
    }

    @Override
    public UserVO queryByUsername(String username) {
        return userService.queryByUsername(username);
    }

    @Override
    public UserWithRoleInfoVO queryUserWithRoleVOByUsername(String username) {
        return null;
    }


    @Override
    public UserVO queryByUsernameAndPassword(String username, String password) {
        return userService.queryByUsernameAndPassword(username,password);
    }
}
